﻿//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Text;
//
//using Microsoft.WindowsAzure.StorageClient;
//using Microsoft.WindowsAzure;
//using Microsoft.WindowsAzure.ServiceRuntime;
//using System.IO;

//namespace AzureGames.Data.Implementation
//{
//    public abstract class AzureBlobRepository<T> where T : CloudBlob
//    {
//        protected CloudBlobContainer blobContainer;
         

//        public AzureBlobRepository()
//        {
//            InitialiseContainer();
//        }

//        public T Get(string itemID)
//        {
//            var blob = blobContainer.GetBlobReference(itemID);

//            if (blob != null)
//                return blob as T;

//            return null;
//        }

//        public void Add(CloudBlob item, Guid itemID)
//        {
//           var blob = blobContainer.
//        }

//        public void Update(CloudBlob item)
//        {
//            throw new NotImplementedException();
//        }

//        public void Delete(CloudBlob item)
//        {
//            throw new NotImplementedException();
//        }

//        private void InitialiseContainer()
//        {
//            var account = CloudStorageAccount.FromConfigurationSetting("DataConnectionString");
//            var client = account.CreateCloudBlobClient();
//            //var container = client.GetContainerReference(RoleEnvironment.GetConfigurationSettingValue("ContainerName"));
//            blobContainer = client.GetContainerReference("Resources");
//            var created = blobContainer.CreateIfNotExist();
            
//            //if (created && client.BaseUri.IsLoopback)
//            //{
//            //    //makes sure the dev blob has all the files in it
//            //    //CCTODO find out how people usually deploy stuff to the real cloud blob?
//            //    AddAllFilesToBlob();
//            //}
//        }

       
       


       
//    }
//}
